package com.dhcc.bpm.modules.log.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dhcc.bpm.modules.log.entity.GatewayLogDay;
import com.dhcc.bpm.modules.log.mapper.GatewayLogDayMapper;
import com.dhcc.bpm.modules.log.service.IGatewayLogDayService;
import com.dhcc.bpm.modules.log.vo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName GatewayLogDayServiceImpl.class
 * @Description  网关访问记录日表 服务实现类
 * @Author xiaFaYu
 * @Date 2019-12-16 14:16
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */
@Service
public class GatewayLogDayServiceImpl extends ServiceImpl<GatewayLogDayMapper, GatewayLogDay> implements IGatewayLogDayService {
	@Autowired
	private GatewayLogDayMapper gatewayLogDayMapper;
	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:39
	 * @param page
	 * @param gatewayLogDay
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.GatewayLogDayVO>
	 **/
	@Override
	public IPage<GatewayLogDayVO> selectGatewayLogDayPage(IPage<GatewayLogDayVO> page, GatewayLogDayVO gatewayLogDay) {
		return page.setRecords(baseMapper.selectGatewayLogDayPage(page, gatewayLogDay));
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:39
	 * @param page
	 * @param apiRankVo
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.ApiRankVo>
	 **/
	@Override
	public IPage<ApiRankVo> countApiNum(IPage<ApiRankVo> page, ApiRankVo apiRankVo){
		return gatewayLogDayMapper.countApiNum(page, apiRankVo);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:39
	 * @param page
	 * @param apiRankVo
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.AppRankVo>
	 **/
	@Override
	public IPage<AppRankVo> countAppNum(IPage<AppRankVo> page, AppRankVo apiRankVo){
		return gatewayLogDayMapper.countAppNum(page, apiRankVo);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:39
	 * @param page
	 * @param apiRankVo
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.ProductRankVo>
	 **/
	@Override
	public IPage<ProductRankVo> countProductNum(IPage<ProductRankVo> page, ProductRankVo apiRankVo){
		return gatewayLogDayMapper.countProductNum(page, apiRankVo);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:39
	 * @param page
	 * @param apiRankVo
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.ApiRankVo>
	 **/
	@Override
	public IPage<ApiRankVo> countCostApiNum(IPage<ApiRankVo> page, ApiRankVo apiRankVo){
		return gatewayLogDayMapper.countCostApiNum(page, apiRankVo);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:39
	 * @param page
	 * @param apiRankVo
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.OrgaRankVo>
	 **/
	@Override
	public IPage<OrgaRankVo> countOrgaNum(IPage<OrgaRankVo> page, OrgaRankVo apiRankVo){
		return gatewayLogDayMapper.countOrgaNum(page, apiRankVo);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:40
	 * @param apiRank
	 * @return java.lang.Integer
	 **/
	@Override
	public Long countLastDayApiNum(ApiRankVo apiRank){
		return gatewayLogDayMapper.countLastDayApiNum(apiRank);

	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:40
	 * @param gatewayLogDay
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.TradeTrendsVo>
	 **/
	@Override
	public List<TradeTrendsVo> countNumBydate(GatewayLogDayVO gatewayLogDay) {
		return gatewayLogDayMapper.countNumBydate(gatewayLogDay);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:40
	 * @param gatewayLogDay
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.TradeTrendsVo>
	 **/
	@Override
	public List<TradeTrendsVo> countNumByYear(GatewayLogDayVO gatewayLogDay) {
		return gatewayLogDayMapper.countNumByYear(gatewayLogDay);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:40
	 * @param api
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
	 **/
	@Override
	public List<AppApiViewVo> countApiData(AppApiViewVo api) {
		return gatewayLogDayMapper.countApiData(api);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:40
	 * @param api
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.ProductRankVo>
	 **/
	@Override
	public List<ProductRankVo> countProductByDate(ProductRankVo api) {
		return gatewayLogDayMapper.countProductByDate(api);
	}

	/**
 	 * @Description 查询
 	 * @Author xiafayu
	 * @Date 2020/2/24 15:40
 	 * @param appApiViewVo
	 * @return com.dhcc.bpm.modules.log.vo.AppApiViewVo
	 **/
    @Override
    public AppApiViewVo countAppData(AppApiViewVo appApiViewVo) {
        return gatewayLogDayMapper.countAppData(appApiViewVo);
    }

    /**
     * @Description 查询
     * @Author xiafayu
     * @Date 2020/2/24 15:41
     * @param appApiViewVo
     * @return java.util.List<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
     **/
	@Override
	public List<AppApiViewVo> apiChartData(AppApiViewVo appApiViewVo) {
		return gatewayLogDayMapper.apiChartData(appApiViewVo);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:41
	 * @param app
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
	 **/
	@Override
	public List<AppApiViewVo> countAppDataByDate(AppApiViewVo app) {
		return gatewayLogDayMapper.countAppDataByDate(app);
	}


//    @Override
//    public List<ApiRankVo> countAppNum(ApiRankVo appRankVo) {
//        return gatewayLogDayMapper.countAppNum(appRankVo);
//    }

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:41
	 * @param req
	 * @return com.dhcc.bpm.modules.log.vo.TradeVolumnVo
	 **/
	@Override
	public TradeVolumnVo tradingVolume(TradeVolumnVo req) {
		return gatewayLogDayMapper.tradingVolume(req);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:41
	 * @param gatewayLogDayVO
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.TradeAppVo>
	 **/
	@Override
	public List<TradeAppVo> selectCountByDate(GatewayLogDayVO gatewayLogDayVO) {
		return gatewayLogDayMapper.selectCountByDate(gatewayLogDayVO);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:41
	 * @param gatewayLogDayVO
	 * @return java.util.List<com.dhcc.bpm.modules.log.vo.TradeAppVo>
	 **/
	@Override
	public List<TradeAppVo> selectCountByYear(GatewayLogDayVO gatewayLogDayVO) {
		return gatewayLogDayMapper.selectCountByYear(gatewayLogDayVO);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:44
	 * @param appApiViewVo
	 * @return com.dhcc.bpm.modules.log.vo.AppApiViewVo
	 **/
	@Override
	public AppApiViewVo apiCount(AppApiViewVo appApiViewVo) {
		return gatewayLogDayMapper.apiCount(appApiViewVo);
	}

	@Override
	public AppApiViewVo getCountBySysId(Long sysId) {
		return gatewayLogDayMapper.getCountBySysId(sysId);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:41
	 * @param page
	 * @param appApiViewVo
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
	 **/
	@Override
	public IPage<AppApiViewVo> selectAppApiNum(IPage<Object> page, AppApiViewVo appApiViewVo) {
		return gatewayLogDayMapper.selectAppApiNum(page, appApiViewVo);
	}

	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:44
	 * @param page
	 * @param appApiViewVo
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
	 **/
	@Override
	public IPage<AppApiViewVo> selectProApiNum(IPage<Object> page, AppApiViewVo appApiViewVo) {
		return gatewayLogDayMapper.selectProApiNum(page, appApiViewVo);
	}
	/**
	 * @Description 查询
	 * @Author xiafayu
	 * @Date 2020/2/24 15:44
	 * @param page
	 * @param appApiViewVo
	 * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
	 **/
	@Override
	public IPage<AppApiViewVo> selectProApiNumHour(IPage<Object> page, AppApiViewVo appApiViewVo) {
		return gatewayLogDayMapper.selectProApiNumHour(page, appApiViewVo);
	}

	
	/**
	 * 查询tps
	 * sunhaobo
	 */
	@Override
	public Double countTps(ApiRankVo apiRank) {
		return gatewayLogDayMapper.countTps(apiRank);
	}


}
